<template>
<div>
    <h2>List</h2>
    <button @click="getListData">点击向父组件传递数据</button>
</div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
      list: [
        { name: "xiaoming", age: 18 },
        { name: "xiaowang", age: 19 },
        { name: "xiaoli", age: 20 },
      ],
    }
  },
  methods:{
    getListData(){
      this.$emit('getListData',this.list)
    }
  }
};
</script>

<style>
</style>